#pragma once

#include <mutex>
#include <thread>
#include <condition_variable>

using namespace std;

class EventLoop;

class EventLoopThread 
{
public:
    EventLoopThread();
    ~EventLoopThread();
    EventLoop* startLoop();
    std::thread::id tid();
private:
    void threadFunc();

    EventLoop* loop_;
    bool exiting_;
    thread thread_;
    mutex mutex_;
    condition_variable cond_;
};